package com.entity;

import com.hb.Insert;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * userinfo
 * @author 
 */
@ApiModel(description = "用户属性封装类")
public class Userinfo implements Serializable {
    @ApiModelProperty(name = "uid",value = "用户ID")
    private Integer uid;

    @NotNull(message = "用户名不能为空", groups = Insert.class)
    @ApiModelProperty(name = "uname",value = "用户名称")
    private String uname;

    @NotNull(message = "用户密码不能为空", groups = Insert.class)
    @ApiModelProperty(name = "upass",value = "用户密码")
    private String upass;

    @ApiModelProperty(name = "isdelete",value = "是否删除")
    private Boolean isdelete;

    @ApiModelProperty(name = "indeptid",value = "所属机构")
    private Integer indeptid;

    private static final long serialVersionUID = 1L;

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public String getUpass() {
        return upass;
    }

    public void setUpass(String upass) {
        this.upass = upass;
    }

    public Boolean getIsdelete() {
        return isdelete;
    }

    public void setIsdelete(Boolean isdelete) {
        this.isdelete = isdelete;
    }

    public Integer getIndeptid() {
        return indeptid;
    }

    public void setIndeptid(Integer indeptid) {
        this.indeptid = indeptid;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Userinfo other = (Userinfo) that;
        return (this.getUid() == null ? other.getUid() == null : this.getUid().equals(other.getUid()))
            && (this.getUname() == null ? other.getUname() == null : this.getUname().equals(other.getUname()))
            && (this.getUpass() == null ? other.getUpass() == null : this.getUpass().equals(other.getUpass()))
            && (this.getIsdelete() == null ? other.getIsdelete() == null : this.getIsdelete().equals(other.getIsdelete()))
            && (this.getIndeptid() == null ? other.getIndeptid() == null : this.getIndeptid().equals(other.getIndeptid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());
        result = prime * result + ((getUname() == null) ? 0 : getUname().hashCode());
        result = prime * result + ((getUpass() == null) ? 0 : getUpass().hashCode());
        result = prime * result + ((getIsdelete() == null) ? 0 : getIsdelete().hashCode());
        result = prime * result + ((getIndeptid() == null) ? 0 : getIndeptid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", uid=").append(uid);
        sb.append(", uname=").append(uname);
        sb.append(", upass=").append(upass);
        sb.append(", isdelete=").append(isdelete);
        sb.append(", indeptid=").append(indeptid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
